<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * Work with socket connections.
<span class='line'>  3</span>  *
<span class='line'>  4</span>  * The connection class provides methods for a client to establish a
<span class='line'>  5</span>  *   network connection to a server, and for both peers to operate the
<span class='line'>  6</span>  *   connection thereafter.
<span class='line'>  7</span>  *
<span class='line'>  8</span>  * @name Connection
<span class='line'>  9</span>  * @exports Connection as api.Connection
<span class='line'> 10</span>  * @class
<span class='line'> 11</span>  */</span><span class="WHIT">
<span class='line'> 12</span> 
<span class='line'> 13</span> 
<span class='line'> 14</span> </span><span class="COMM">/**
<span class='line'> 15</span>  * Start connection negotiation.
<span class='line'> 16</span>  *
<span class='line'> 17</span>  * This method starts the connection negotiation process by telling
<span class='line'> 18</span>  *     the client the protocol version that the server proposes, along
<span class='line'> 19</span>  *     with a list of security mechanisms which the client can use for
<span class='line'> 20</span>  *     authentication.
<span class='line'> 21</span>  *
<span class='line'> 22</span>  * @name Connection#start
<span class='line'> 23</span>  * @event
<span class='line'> 24</span>  * @param {Number} versionMajor The protocol major version that the server agrees to use, which
<span class='line'> 25</span>  *       cannot be higher than the client's major version.
<span class='line'> 26</span>  * @param {Number} versionMinor The protocol minor version that the server agrees to use, which
<span class='line'> 27</span>  *       cannot be higher than the client's minor version.
<span class='line'> 28</span>  * @param {Object} serverProperties This string provides a set of peer properties, used for
<span class='line'> 29</span>  * identification, debugging, and general information.
<span class='line'> 30</span>  * @param {String} mechanisms A list of the security mechanisms that the server supports, delimited
<span class='line'> 31</span>  *       by spaces.  Currently ASL supports these mechanisms: PLAIN.
<span class='line'> 32</span>  * @param {String} locales A list of the message locales that the server supports, delimited
<span class='line'> 33</span>  *       by spaces.  The locale defines the language in which the server
<span class='line'> 34</span>  *       will send reply texts.
<span class='line'> 35</span>  */</span><span class="WHIT">
<span class='line'> 36</span> 
<span class='line'> 37</span> </span><span class="COMM">/**
<span class='line'> 38</span>  * Security mechanism challenge.
<span class='line'> 39</span>  *
<span class='line'> 40</span>  * The SASL protocol works by exchanging challenges and responses until
<span class='line'> 41</span>  *     both peers have received sufficient information to authenticate each
<span class='line'> 42</span>  *     other.  This method challenges the client to provide more information.
<span class='line'> 43</span>  *
<span class='line'> 44</span>  * @name Connection#secure
<span class='line'> 45</span>  * @event
<span class='line'> 46</span>  * @param {String} challenge Challenge information, a block of opaque binary data passed to
<span class='line'> 47</span>  *       the security mechanism.
<span class='line'> 48</span>  */</span><span class="WHIT">
<span class='line'> 49</span> 
<span class='line'> 50</span> </span><span class="COMM">/**
<span class='line'> 51</span>  * Propose connection tuning parameters.
<span class='line'> 52</span>  *
<span class='line'> 53</span>  * This method proposes a set of connection configuration values
<span class='line'> 54</span>  *     to the client.  The client can accept and/or adjust these.
<span class='line'> 55</span>  *
<span class='line'> 56</span>  * @name Connection#tune
<span class='line'> 57</span>  * @event
<span class='line'> 58</span>  * @param {Number} channelMax The maximum total number of channels that the server allows
<span class='line'> 59</span>  *       per connection. Zero means that the server does not impose a
<span class='line'> 60</span>  *       fixed limit, but the number of allowed channels may be limited
<span class='line'> 61</span>  *       by available server resources.
<span class='line'> 62</span>  * @param {Number} frameMax The largest frame size that the server proposes for the
<span class='line'> 63</span>  *       connection. The client can negotiate a lower value.  Zero means
<span class='line'> 64</span>  *       that the server does not impose any specific limit but may reject
<span class='line'> 65</span>  *       very large frames if it cannot allocate resources for them.
<span class='line'> 66</span>  * @param {Number} heartbeat The delay, in seconds, of the connection heartbeat that the server
<span class='line'> 67</span>  *       wants.  Zero means the server does not want a heartbeat.
<span class='line'> 68</span>  */</span><span class="WHIT">
<span class='line'> 69</span> 
<span class='line'> 70</span> </span><span class="COMM">/**
<span class='line'> 71</span>  * Signal that the connection is ready.
<span class='line'> 72</span>  *
<span class='line'> 73</span>  * This method signals to the client that the connection is ready for
<span class='line'> 74</span>  *     use.
<span class='line'> 75</span>  *
<span class='line'> 76</span>  * @name Connection#openOk
<span class='line'> 77</span>  * @event
<span class='line'> 78</span>  * @param {String} knownHosts Specifies the list of equivalent or alternative hosts that the server
<span class='line'> 79</span>  * knows about, which will normally include the current server itself.
<span class='line'> 80</span>  * Clients can cache this information and use it when reconnecting to a
<span class='line'> 81</span>  * server after a failure.
<span class='line'> 82</span>  */</span><span class="WHIT">
<span class='line'> 83</span> 
<span class='line'> 84</span> </span><span class="COMM">/**
<span class='line'> 85</span>  * Asks the client to use a different server.
<span class='line'> 86</span>  *
<span class='line'> 87</span>  * This method redirects the client to another server, based on the
<span class='line'> 88</span>  *     requested virtual host and/or capabilities.
<span class='line'> 89</span>  *
<span class='line'> 90</span>  * @name Connection#redirect
<span class='line'> 91</span>  * @event
<span class='line'> 92</span>  * @param {String} host Specifies the server to connect to.  This is an IP address or a
<span class='line'> 93</span>  *       DNS name, optionally followed by a colon and a port number. If
<span class='line'> 94</span>  *       no port number is specified, the client should use the default
<span class='line'> 95</span>  *       port number for the protocol.
<span class='line'> 96</span>  * @param {String} knownHosts Specifies the list of equivalent or alternative hosts that the server
<span class='line'> 97</span>  * knows about, which will normally include the current server itself.
<span class='line'> 98</span>  * Clients can cache this information and use it when reconnecting to a
<span class='line'> 99</span>  * server after a failure.
<span class='line'>100</span>  */</span><span class="WHIT">
<span class='line'>101</span> 
<span class='line'>102</span> </span><span class="COMM">/**
<span class='line'>103</span>  * Request a connection close.
<span class='line'>104</span>  *
<span class='line'>105</span>  * This method indicates that the sender wants to close the connection.
<span class='line'>106</span>  *     This may be due to internal conditions (e.g. a forced shut-down) or
<span class='line'>107</span>  *     due to an error handling a specific method, i.e. an exception.  When
<span class='line'>108</span>  *     a close is due to an exception, the sender provides the class and
<span class='line'>109</span>  *     method id of the method which caused the exception.
<span class='line'>110</span>  *
<span class='line'>111</span>  * @name Connection#close
<span class='line'>112</span>  * @event
<span class='line'>113</span>  * @param {Number} replyCode The reply code. The AMQ reply codes are defined in AMQ RFC 011.
<span class='line'>114</span>  * @param {String} replyText The localised reply text.  This text can be logged as an aid to
<span class='line'>115</span>  *   resolving issues.
<span class='line'>116</span>  * @param {Number} classId 
<span class='line'>117</span>  * @param {Number} methodId 
<span class='line'>118</span>  */</span><span class="WHIT">
<span class='line'>119</span> 
<span class='line'>120</span> </span><span class="COMM">/**
<span class='line'>121</span>  * Confirm a connection close.
<span class='line'>122</span>  *
<span class='line'>123</span>  * This method confirms a Connection.Close method and tells the
<span class='line'>124</span>  *     recipient that it is safe to release resources for the connection
<span class='line'>125</span>  *     and close the socket.
<span class='line'>126</span>  *
<span class='line'>127</span>  * @name Connection#closeOk
<span class='line'>128</span>  * @event
<span class='line'>129</span>  * 
<span class='line'>130</span>  */</span><span class="WHIT">
<span class='line'>131</span> 
<span class='line'>132</span> 
<span class='line'>133</span> 
<span class='line'>134</span> </span><span class="COMM">/**
<span class='line'>135</span>  * Select security mechanism and locale.
<span class='line'>136</span>  *
<span class='line'>137</span>  * This method selects a SASL security mechanism. ASL uses SASL
<span class='line'>138</span>  *     (RFC2222) to negotiate authentication and encryption.
<span class='line'>139</span>  *
<span class='line'>140</span>  * @name Connection#startOk
<span class='line'>141</span>  * @function
<span class='line'>142</span>  * @param {Object} clientProperties This string provides a set of peer properties, used for
<span class='line'>143</span>  * identification, debugging, and general information.
<span class='line'>144</span>  * @param {String} mechanism A single security mechanisms selected by the client, which must be
<span class='line'>145</span>  *       one of those specified by the server.
<span class='line'>146</span>  * @param {String} response A block of opaque data passed to the security mechanism. The contents
<span class='line'>147</span>  *       of this data are defined by the SASL security mechanism.  For the
<span class='line'>148</span>  *       PLAIN security mechanism this is defined as a field table holding
<span class='line'>149</span>  *       two fields, LOGIN and PASSWORD.
<span class='line'>150</span>  * @param {String} locale A single message local selected by the client, which must be one
<span class='line'>151</span>  *       of those specified by the server.
<span class='line'>152</span>  */</span><span class="WHIT">
<span class='line'>153</span> 
<span class='line'>154</span> </span><span class="COMM">/**
<span class='line'>155</span>  * Security mechanism response.
<span class='line'>156</span>  *
<span class='line'>157</span>  * This method attempts to authenticate, passing a block of SASL data
<span class='line'>158</span>  *     for the security mechanism at the server side.
<span class='line'>159</span>  *
<span class='line'>160</span>  * @name Connection#secureOk
<span class='line'>161</span>  * @function
<span class='line'>162</span>  * @param {String} response A block of opaque data passed to the security mechanism.  The contents
<span class='line'>163</span>  *       of this data are defined by the SASL security mechanism.
<span class='line'>164</span>  */</span><span class="WHIT">
<span class='line'>165</span> 
<span class='line'>166</span> </span><span class="COMM">/**
<span class='line'>167</span>  * Negotiate connection tuning parameters.
<span class='line'>168</span>  *
<span class='line'>169</span>  * This method sends the client's connection tuning parameters to the
<span class='line'>170</span>  *     server. Certain fields are negotiated, others provide capability
<span class='line'>171</span>  *     information.
<span class='line'>172</span>  *
<span class='line'>173</span>  * @name Connection#tuneOk
<span class='line'>174</span>  * @function
<span class='line'>175</span>  * @param {Number} channelMax The maximum total number of channels that the client will use
<span class='line'>176</span>  *       per connection.  May not be higher than the value specified by
<span class='line'>177</span>  *       the server.
<span class='line'>178</span>  * @param {Number} frameMax The largest frame size that the client and server will use for
<span class='line'>179</span>  *       the connection.  Zero means that the client does not impose any
<span class='line'>180</span>  *       specific limit but may reject very large frames if it cannot
<span class='line'>181</span>  *       allocate resources for them.  Note that the frame-max limit
<span class='line'>182</span>  *       applies principally to content frames, where large contents
<span class='line'>183</span>  *       can be broken into frames of arbitrary size.
<span class='line'>184</span>  * @param {Number} heartbeat The delay, in seconds, of the connection heartbeat that the client
<span class='line'>185</span>  *       wants. Zero means the client does not want a heartbeat.
<span class='line'>186</span>  */</span><span class="WHIT">
<span class='line'>187</span> 
<span class='line'>188</span> </span><span class="COMM">/**
<span class='line'>189</span>  * Open connection to virtual host.
<span class='line'>190</span>  *
<span class='line'>191</span>  * This method opens a connection to a virtual host, which is a
<span class='line'>192</span>  *     collection of resources, and acts to separate multiple application
<span class='line'>193</span>  *     domains within a server.
<span class='line'>194</span>  *
<span class='line'>195</span>  * @name Connection#open
<span class='line'>196</span>  * @function
<span class='line'>197</span>  * @param {String} virtualHost Must start with a slash "/" and continue with path names
<span class='line'>198</span>  *   separated by slashes. A path name consists of any combination
<span class='line'>199</span>  *   of at least one of [A-Za-z0-9] plus zero or more of [.-_+!=:].
<span class='line'>200</span>  * @param {String} capabilities The client may specify a number of capability names, delimited by
<span class='line'>201</span>  *       spaces.  The server can use this string to how to process the
<span class='line'>202</span>  *       client's connection request.
<span class='line'>203</span>  * @param {Boolean} insist In a configuration with multiple load-sharing servers, the server
<span class='line'>204</span>  *       may respond to a Connection.Open method with a Connection.Redirect.
<span class='line'>205</span>  *       The insist option tells the server that the client is insisting on
<span class='line'>206</span>  *       a connection to the specified server.
<span class='line'>207</span>  */</span><span class="WHIT">
<span class='line'>208</span> 
<span class='line'>209</span> </span><span class="COMM">/**
<span class='line'>210</span>  * Request a connection close.
<span class='line'>211</span>  *
<span class='line'>212</span>  * This method indicates that the sender wants to close the connection.
<span class='line'>213</span>  *     This may be due to internal conditions (e.g. a forced shut-down) or
<span class='line'>214</span>  *     due to an error handling a specific method, i.e. an exception.  When
<span class='line'>215</span>  *     a close is due to an exception, the sender provides the class and
<span class='line'>216</span>  *     method id of the method which caused the exception.
<span class='line'>217</span>  *
<span class='line'>218</span>  * @name Connection#close
<span class='line'>219</span>  * @function
<span class='line'>220</span>  * @param {Number} replyCode The reply code. The AMQ reply codes are defined in AMQ RFC 011.
<span class='line'>221</span>  * @param {String} replyText The localised reply text.  This text can be logged as an aid to
<span class='line'>222</span>  *   resolving issues.
<span class='line'>223</span>  * @param {Number} classId 
<span class='line'>224</span>  * @param {Number} methodId 
<span class='line'>225</span>  */</span><span class="WHIT">
<span class='line'>226</span> 
<span class='line'>227</span> </span><span class="COMM">/**
<span class='line'>228</span>  * Confirm a connection close.
<span class='line'>229</span>  *
<span class='line'>230</span>  * This method confirms a Connection.Close method and tells the
<span class='line'>231</span>  *     recipient that it is safe to release resources for the connection
<span class='line'>232</span>  *     and close the socket.
<span class='line'>233</span>  *
<span class='line'>234</span>  * @name Connection#closeOk
<span class='line'>235</span>  * @function
<span class='line'>236</span>  * 
<span class='line'>237</span>  */</span><span class="WHIT">
<span class='line'>238</span> 
<span class='line'>239</span> </span></pre></body></html>